#ifndef WATCHDIINSTRUCTIONVIEW_H
#define WATCHDIINSTRUCTIONVIEW_H

#include <QWidget>
#include "../ProgramSet/watchdiinstruction.h"
namespace Ui {
class WatchDIInstructionView;
}

class WatchDIInstructionView : public QWidget
{
    Q_OBJECT

public:
    explicit WatchDIInstructionView(int styleId,QWidget *parent = 0);
    ~WatchDIInstructionView();
public:
    /**
     * @brief getInput             获取界面输入
     */
    void getInput(WatchDIInstruction &instructionParaOut);

    /**
     * @brief updateView            根据instructionPara更新数据显示在界面
     */
    void updateView();

    /**
     * @brief changeLanguage      界面语言切换
     * @param language
     */
    void changeLanguage(int language);

    void initialDisplayStyle(int styleId);

private:
    void finishEditInstruction(WatchDIInstruction instructionParaIn,QString &instructionStrOut);

private slots:
    void on_radioButton_watchTime_clicked(bool checked);

    void on_radioButton_counter_clicked(bool checked);

    void on_clearNote_Btn_clicked();

    void on_save_Btn_clicked();

signals:
    /**
     * @brief cleanNoteStrSignal             删除注释信号
     */
    void cleanNoteStrSignal();

    /**
     * @brief finishEditInstruction         指令属性编辑完成
     */
    void finishEditInstructionSignal();

    /**
     * @brief saveInstructionSignal         保存指令
     * @param instructionStr                指令字符串
     */
    void saveInstructionSignal(const QString& instructionStr);

    /**
     * @brief showErrorMsgBox 显示信息弹窗内容
     * @param msg
     */

    void showErrorMsgBox(QString msg);

public:
        QString instructionStr;
        WatchDIInstruction instructionPara;
private:
    Ui::WatchDIInstructionView *ui;
};

#endif // WATCHDIINSTRUCTIONVIEW_H
